Skip to content

.Net: Migrate Azure Chat Completion Service to AzureOpenAI SDK v2 - #6984

Merged
Roger Barreto (rogerbarreto) merged 5 commits into
microsoft:feature-connectors-openaifrom
SergeyMenshykh:migrate-chat-completion-to-new-azure-sdk
Jun 27, 2024
Merged

.Net: Migrate Azure Chat Completion Service to AzureOpenAI SDK v2#6984
Roger Barreto (rogerbarreto) merged 5 commits into
microsoft:feature-connectors-openaifrom
SergeyMenshykh:migrate-chat-completion-to-new-azure-sdk

Conversation

@SergeyMenshykh

@SergeyMenshykh SergeyMenshykh commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

Motivation and Context

This PR is the next step in a series of follow-up PRs to migrate AzureOpenAIConnector to Azure AI SDK v2. It updates all code related to AzureOpenAI ChatCompletionService to use the Azure AI SDK v2. One of the goals of the PR is to update the code with a minimal number of changes to make the code review as easy as possible, so almost all methods keep their names as they were even though they might not be relevant anymore. This will be fixed in one of the follow-up PRs.

Description

This PR does the following:

  1. Migrates AzureOpenAIChatCompletionService, ClientCore, and other model classes both use, to Azure AI SDK v2.
  2. Updates ToolCallBehavior classes to return a list of functions and function choice. This change is required because the new SDK model requires both of those for the CompletionsOptions class creation and does not allow setting them after the class is already created, as it used to allow.
  3. Adapts related unit tests to the API changes.

Next steps

  1. Add integration tests.
  2. Rename internal/private methods that were intentionally left with old, irrelevant names to minimize the code review delta.

Out of scope:

Contribution Checklist

@SergeyMenshykh
SergeyMenshykh requested a review from a team as a code owner June 27, 2024 10:23
@SergeyMenshykh SergeyMenshykh self-assigned this Jun 27, 2024
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Jun 27, 2024
Comment thread dotnet/src/Connectors/Connectors.AzureOpenAI.UnitTests/AzureOpenAITestHelper.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.AzureOpenAI/AzureToolCallBehavior.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.AzureOpenAI/Core/ClientCore.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.AzureOpenAI/Core/ClientCore.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.AzureOpenAI/Core/ClientCore.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.AzureOpenAI/Core/ClientCore.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.AzureOpenAI/Core/ClientCore.cs
@rogerbarreto
Roger Barreto (rogerbarreto) merged commit f8a22b8 into microsoft:feature-connectors-openai Jun 27, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants